#ifndef __TROPHY_LOGO_CANVASCONTAINER_H__
#define __TROPHY_LOGO_CANVASCONTAINER_H__

#include "resource.h"
#include "SimpleWnd/SimpleWnd.h"
#include "SplitterWnd.h"
#include "CanvasWnd.h"

#define CANVAS_CONTAINER_CLASS "TROPHY_LOGO_CANVAS_CONTAINER"
#define NOMOVE (-0x0fffffff)

class ICanvasContainer
{
public:
    virtual void CanvasSizeChanged() = 0;
    virtual void GetViewPortion(RECT &rc) = 0;
};

class CCanvasContainer : 
    public CWnd,
    public ICanvasContainer,
    public IPaneWindow    
{
public:
    DECLARE_WND_CLASS_EX(CANVAS_CONTAINER_CLASS, 0, COLOR_3DSHADOW)

    CCanvasContainer();
	virtual ~CCanvasContainer();
	
    void SetErrorInfoWindow (HWND hErrWnd);

BEGIN_MSG_MAP(CCanvasContainer)
    MESSAGE_HANDLER(WM_CREATE, OnCreate)
    MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
    MESSAGE_HANDLER(WM_SIZE, OnSize)
    MESSAGE_HANDLER(WM_HSCROLL, OnScroll)
    MESSAGE_HANDLER(WM_VSCROLL, OnScroll)
END_MSG_MAP()
	
public:
// IPaneWindow interface 
    virtual HWND CreatePaneWindow(HWND hParent, RECT& rc, DWORD dwStyle, DWORD dwExStyle);
protected:
    LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
    LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
    LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
    LRESULT OnScroll(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);

    void MoveCanvas (int x, int y);
    int CalcSBPos (WPARAM wParam, long curPos, long upperlimit);
    RECT m_rcCanvas;

public:
// ICanvasContainer interface:
    virtual void CanvasSizeChanged();
    virtual void GetViewPortion(RECT &rc);

public:
    CCanvasWnd m_canvas;
};


#endif /* __TROPHY_LOGO_CANVASCONTAINER_H__ */
